﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.ETL.Domain
{
    public static class DEF
    {
        public class LogLevel
        {
            public const int Info = 1;
            public const int Warning = 2;
            public const int Error = 3;
            public const int Debug = 4;
        }

        /// <summary>
        /// 数据服务类型定义
        /// </summary>
        public class DataServiceTypeId
        {
            public static Guid WS = new Guid("{8D09625B-F618-45C3-81F1-65AD3DF3373A}");
            public static Guid SQL = new Guid("{FBC88932-8500-4D98-B795-FF84AEB002C3}");
            public static Guid Excel = new Guid("{872BAE09-6B32-4DBA-A1C9-B24AF3D79757}");
            public static Guid ExtDS = new Guid("{C7E6E4CA-FC41-41E7-A693-201607A27B39}");
            public static Guid RawData = new Guid("{09F75019-CBEA-401A-80A4-47502C057302}");
            public static Guid DataService = new Guid("{D75C0354-4F07-4C2D-80B5-055B3105401E}");
            public static Guid Oracle = new Guid("{9E009B1A-98B5-44C6-8D85-525D9A3952E9}");
            public static Guid MySql = new Guid("{1AD086AB-2428-48A3-A845-1B11EDE2C92A}");
        }

        /// <summary>
        /// 任务运行模式
        /// </summary>
        public class TaskRunMode
        {
            public const int Timer = 0x01;
            public const int Alarm = 0x02;
            public const int Manual = 0x03;
            public const int Event = 0x04;
        }

        /// <summary>
        /// timer mode
        /// </summary>
        public static class TaskTimerMode
        {
            /// <summary>
            /// 天
            /// </summary>
            public const int Day = 0x01;

            /// <summary>
            /// 小时
            /// </summary>
            public const int Hour = 0x02;

            /// <summary>
            /// 分
            /// </summary>
            public const int Minute = 0x03;
        }

        /// <summary>
        /// 任务闹表执行模式
        /// </summary>
        public static class TaskAlarmMode
        {
            /// <summary>
            /// 每年
            /// </summary>
            public const int PreYear = 0x01;
            /// <summary>
            /// 每月
            /// </summary>
            public const int PreMonth = 0x02;
            /// <summary>
            /// 每周
            /// </summary>
            public const int PreWeek = 0x03;
            /// <summary>
            /// 每天
            /// </summary>
            public const int PreDay = 0x04;
        }

        /// <summary>
        /// 数据验证规则类型
        /// </summary>
        public class DataVerificationRuleType
        {
            public const int Script = 0x01;
            public const int PlugIn = 0x02;
            public const int StoredProcedure = 0x03;
        }

        /// <summary>
        /// 任务的参数类型
        /// </summary>
        public class TaskParameterType
        {
            /// <summary>
            /// 值
            /// </summary>
            public const int Value = 0x01;

            /// <summary>
            /// 脚本定义,表达式
            /// </summary>
            public const int Expression = 0x02;

            /// <summary>
            /// 循环执行的值数组，通过“,”来间隔
            /// </summary>
            public const int ForeachArray = 0x03;
        }

        /// <summary>
        /// 原始数据的状态
        /// </summary>
        public class RawDataStatus
        {
            /// <summary>
            /// 数据类型不匹配
            /// </summary>
            public const int TypeVerificationFailure = 0x01;

            /// <summary>
            /// 数据审核失败
            /// </summary>
            public const int DataVerificationFailure = 0x02;

            /// <summary>
            /// 编码转换失败
            /// </summary>
            public const int CodeConvertionFailure = 0x03;

            /// <summary>
            /// 等待数据审核
            /// </summary>
            public const int WaitDataVerification = 0x04;

            /// <summary>
            /// 插入数据失败
            /// </summary>
            public const int InsertFailure = 0x05;

            /// <summary>
            /// 插入数据成功
            /// </summary>
            public const int InsertSuccess = 0x06;
        }

        public class TaskStep
        {
            /// <summary>
            /// </summary>
            public const int WaiteTypeVerification = 0x01;

            /// <summary>
            /// </summary>
            public const int WaiteDataVerification = 0x02;

            /// <summary>
            /// </summary>
            public const int WaitCodeConvertion = 0x03;

            /// <summary>
            /// </summary>
            public const int WaitInsert = 0x04;

            /// <summary>
            /// 结束
            /// </summary>
            public const int Finished = 0x05;
        }

        public class DtTableColumns
        {
            public const string SYSCOL_Id = "_Id";
            public const string SYSCOL_BatchId = "_BatchId";
            public const string SYSCOL_State = "_State";
            public const string SYSCOL_CreatedTime = "_CreatedTime";
            public const string SYSCOL_RowIndex = "_RowIndex";
        }

        public class DtTableDataUpdateReason
        {
            /// <summary>
            /// 抽取
            /// </summary>
            public const int Extract = 0x01;

            /// <summary>
            /// 调整
            /// </summary>
            public const int Adjust = 0x02;
        }

        public class PubDataSetType
        {
            public const int Statement = 0x01;
            public const int StoredProcedure = 0x02;
        }

        /// <summary>
        /// 原始数据服务
        /// </summary>
        public class RawDataService
        {
            /// <summary>
            /// 数据表类型
            /// </summary>
            public const int DataTable = 0x01;
        }
    }
}
